package com.example.flower_shop.vo.user;

import com.example.flower_shop.enums.RoleEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
@Schema(description = "用户注册请求对象")
public class UserRegReqVO {

    @Schema(description = "昵称", example = "张三")
    private String nickname;

    @Schema(description = "账号", example = "zhangsan123")
    @NotBlank(message = "账号不能为空")
    @Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9_-]{5,15}$", message = "账号必须为字母开头的6-16位字母、数字、下划线或减号")
    private String username;

    @Schema(description = "密码", example = "password123")
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^[0-9A-Za-z]{6,16}$", message = "密码必须为6-16位数字、字母")
    private String password;

    @Schema(description = "确认密码", example = "password123")
    @NotBlank(message = "确认密码不能为空")
    private String confirmPassword;

    @Schema(description = "手机号", example = "13800000000")
    @Pattern(regexp = "^1[34578]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Schema(description = "邮箱", example = "zhangsan@example.com")
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", message = "邮箱格式不正确")
    private String email;

    @Schema(description = "角色", example = "user")
    private RoleEnum role;

}
